import { CHARGING_TIMES, CHARGING_AMOUNT, OPERATE_TREND, LOW_BATTERY_MONITOR, MILE_RANK, TRANSPORT_SITUATION,
  OPREATE_SITUATION, ENERY_CONSUME, AVERAGE_CONSUME, CONFIG_PANEL } from '@/services/api'
import { request, METHOD } from '@/utils/request'

/**
 * 获取模板配置项
 * @param params 
 * @returns {Promise<AxiosResponse<T>}
 */
export async function getConfigPanel(params) {
  return request(CONFIG_PANEL, METHOD.GET, params)
}

/**
 * 获取运力概况
 * @param params
 * @returns {Promise<AxiosResponse<T>}
 */
export async function getTransportSituation(params) {
  return request(TRANSPORT_SITUATION, METHOD.GET, params)
}

/**
 * 获取运营概况
 * @param params
 * @returns {Promise<AxiosResponse<T>}
 */
 export async function getOperateSituation(params) {
  return request(OPREATE_SITUATION, METHOD.GET, params)
}

/**
 * 获取总能耗
 * @param params
 * @returns {Promise<AxiosResponse<T>}
 */
export async function getEnergyConsume(params) {
  return request(ENERY_CONSUME, METHOD.GET, params)
}

/**
 * 获取平均能耗
 * @param params 
 * @returns {Promise<AxiosResponse<T>}
 */
export async function getAverageConsume(params) {
  return request(AVERAGE_CONSUME, METHOD.GET, params)
}

/**
 * 获取充电时段
 * @param 
 * @returns {Promise<AxiosResponse<T>}
 */
export async function getChargingTimes(params) {
  return request(CHARGING_TIMES, METHOD.GET, params)
}

/**
 * 获取车均充电次数
 * @param params 时间维度
 * @returns {Promise<AxiosResponse<T>}
 */
export async function getChargingAmount(params) {
  return request(CHARGING_AMOUNT, METHOD.GET, params)
}

/**
 * 获取运营趋势
 * @param params 时间维度
 * @returns {Promise<AxiosResponse<T>}
 */
export async function getOperateTrend(params) {
  return request(OPERATE_TREND, METHOD.GET, params)
}

/**
 * 获取获取低电量监测信息
 * @param params 时间维度
 * @returns {Promise<AxiosResponse<T>}
 */
export async function getChargeMonitor(params) {
  return request(LOW_BATTERY_MONITOR, METHOD.GET, params)
}

/**
 * 获取里程排名
 * @param params 时间维度
 * @returns {Promise<AxiosResponse<T>}
 */
export async function getMileRank(params) {
  return request(MILE_RANK, METHOD.GET, params)
}
